import typeOf from "./typeOf";

/**
 * @param { * } target 
 * @returns { boolean }
 */
const empty = (target) => {
  switch(typeOf(target)) {
    case 'array':
    case 'string':
    case 'object': return Object.keys(target).length === 0;
    default: return target === null;
  }
}

export default empty;